<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>员工信息管理 - 消防工程集团经营管理系统</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            background: #f3f4f6;
        }
    </style>
</head>
<body>
    <!-- Sidebar -->
    <div class="fixed left-0 top-0 bottom-0 w-64 bg-gray-900 text-white shadow-lg">
        <div class="p-6 border-b border-gray-800">
            <div class="flex items-center">
                <i class="fas fa-fire-extinguisher text-2xl text-blue-400 mr-3"></i>
                <div>
                    <div class="font-bold text-lg">消防工程集团</div>
                    <div class="text-xs text-gray-400">管理系统</div>
                </div>
            </div>
        </div>
        <nav class="p-4 space-y-2">
            <a href="dashboard.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-chart-line w-5 mr-3"></i>
                <span>数据看板</span>
            </a>
            <a href="project-list.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-building w-5 mr-3"></i>
                <span>项目管理</span>
            </a>
            <a href="purchase-list.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-shopping-cart w-5 mr-3"></i>
                <span>采购管理</span>
            </a>
            <a href="payment-list.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-money-bill-wave w-5 mr-3"></i>
                <span>付款管理</span>
            </a>
            <a href="inventory.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-warehouse w-5 mr-3"></i>
                <span>库存管理</span>
            </a>
            <a href="hr-dashboard.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-users w-5 mr-3"></i>
                <span>人力成本</span>
            </a>
            <a href="system-settings.html" class="flex items-center px-4 py-3 bg-blue-600 rounded-lg text-white">
                <i class="fas fa-cog w-5 mr-3"></i>
                <span>系统管理</span>
            </a>
        </nav>
    </div>

    <!-- Main Content -->
    <div class="ml-64">
        <header class="bg-white shadow-sm border-b border-gray-200 px-8 py-4">
            <div class="flex items-center justify-between">
                <div class="flex items-center">
                    <a href="system-settings.html" class="text-gray-600 mr-4">
                        <i class="fas fa-arrow-left"></i>
                    </a>
                    <h1 class="text-2xl font-bold text-gray-800">员工信息管理</h1>
                </div>
                <div class="flex items-center gap-3">
                    <button onclick="exportData()" class="bg-gray-100 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-200">
                        <i class="fas fa-download mr-2"></i>导出
                    </button>
                    <button onclick="showAddModal()" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700">
                        <i class="fas fa-plus mr-2"></i>新增员工
                    </button>
                </div>
            </div>
        </header>

        <!-- Filters -->
        <div class="bg-white mx-8 mt-6 rounded-lg shadow-sm p-4">
            <div class="flex items-center gap-4">
                <input type="text" placeholder="搜索员工姓名、工号、手机号..." 
                       class="flex-1 border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                <select class="border border-gray-300 rounded-lg px-4 py-2">
                    <option>全部子公司</option>
                    <option>子公司A</option>
                    <option>子公司B</option>
                    <option>子公司C</option>
                </select>
                <select class="border border-gray-300 rounded-lg px-4 py-2">
                    <option>全部部门</option>
                    <option>工程部</option>
                    <option>采购部</option>
                    <option>财务部</option>
                    <option>行政部</option>
                </select>
                <select class="border border-gray-300 rounded-lg px-4 py-2">
                    <option>全部项目</option>
                    <option>消防工程A项目</option>
                    <option>消防工程B项目</option>
                    <option>消防工程C项目</option>
                </select>
                <select class="border border-gray-300 rounded-lg px-4 py-2">
                    <option>全部状态</option>
                    <option>在职</option>
                    <option>离职</option>
                    <option>试用期</option>
                </select>
                <button class="bg-gray-100 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-200">
                    <i class="fas fa-filter mr-2"></i>筛选
                </button>
            </div>
        </div>

        <!-- Employee List -->
        <main class="p-8">
            <div class="bg-white rounded-lg shadow-sm overflow-hidden">
                <table class="w-full">
                    <thead class="bg-gray-50 border-b border-gray-200">
                        <tr>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">工号</th>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">姓名</th>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">性别</th>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">手机号</th>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">岗位</th>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">所属子公司</th>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">所属部门</th>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">所属项目</th>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">薪资标准</th>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">员工状态</th>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">系统账号</th>
                            <th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase">操作</th>
                        </tr>
                    </thead>
                    <tbody class="divide-y divide-gray-200">
                        <tr class="hover:bg-gray-50">
                            <td class="px-6 py-4 text-sm font-semibold text-gray-900">E001234</td>
                            <td class="px-6 py-4">
                                <div class="flex items-center">
                                    <img src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100&h=100&fit=crop" 
                                         alt="头像" class="w-8 h-8 rounded-full mr-2">
                                    <span class="text-sm text-gray-900">张工</span>
                                </div>
                            </td>
                            <td class="px-6 py-4 text-sm text-gray-700">男</td>
                            <td class="px-6 py-4 text-sm text-gray-700">138****5678</td>
                            <td class="px-6 py-4 text-sm text-gray-700">项目经理</td>
                            <td class="px-6 py-4 text-sm text-gray-700">子公司A</td>
                            <td class="px-6 py-4 text-sm text-gray-700">工程部</td>
                            <td class="px-6 py-4 text-sm text-gray-700">消防工程A项目</td>
                            <td class="px-6 py-4 text-sm font-semibold text-gray-900">¥12,000/月</td>
                            <td class="px-6 py-4">
                                <span class="bg-green-100 text-green-600 text-xs px-2 py-1 rounded">在职</span>
                            </td>
                            <td class="px-6 py-4">
                                <span class="bg-blue-100 text-blue-600 text-xs px-2 py-1 rounded">
                                    <i class="fas fa-check-circle mr-1"></i>已创建
                                </span>
                            </td>
                            <td class="px-6 py-4">
                                <button onclick="editEmployee('E001234')" class="text-blue-600 hover:text-blue-800 text-sm mr-3">编辑</button>
                                <button onclick="viewEmployee('E001234')" class="text-gray-600 hover:text-gray-800 text-sm">查看</button>
                                <button onclick="createUserAccount('E001234')" class="text-green-600 hover:text-green-800 text-sm ml-3">创建账号</button>
                            </td>
                        </tr>
                        <tr class="hover:bg-gray-50">
                            <td class="px-6 py-4 text-sm font-semibold text-gray-900">E001235</td>
                            <td class="px-6 py-4">
                                <div class="flex items-center">
                                    <img src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=100&h=100&fit=crop" 
                                         alt="头像" class="w-8 h-8 rounded-full mr-2">
                                    <span class="text-sm text-gray-900">李工</span>
                                </div>
                            </td>
                            <td class="px-6 py-4 text-sm text-gray-700">女</td>
                            <td class="px-6 py-4 text-sm text-gray-700">139****1234</td>
                            <td class="px-6 py-4 text-sm text-gray-700">采购员</td>
                            <td class="px-6 py-4 text-sm text-gray-700">子公司B</td>
                            <td class="px-6 py-4 text-sm text-gray-700">采购部</td>
                            <td class="px-6 py-4 text-sm text-gray-700">消防工程B项目</td>
                            <td class="px-6 py-4 text-sm font-semibold text-gray-900">¥8,000/月</td>
                            <td class="px-6 py-4">
                                <span class="bg-green-100 text-green-600 text-xs px-2 py-1 rounded">在职</span>
                            </td>
                            <td class="px-6 py-4">
                                <span class="bg-blue-100 text-blue-600 text-xs px-2 py-1 rounded">
                                    <i class="fas fa-check-circle mr-1"></i>已创建
                                </span>
                            </td>
                            <td class="px-6 py-4">
                                <button onclick="editEmployee('E001235')" class="text-blue-600 hover:text-blue-800 text-sm mr-3">编辑</button>
                                <button onclick="viewEmployee('E001235')" class="text-gray-600 hover:text-gray-800 text-sm">查看</button>
                                <button onclick="createUserAccount('E001235')" class="text-green-600 hover:text-green-800 text-sm ml-3">创建账号</button>
                            </td>
                        </tr>
                        <tr class="hover:bg-gray-50">
                            <td class="px-6 py-4 text-sm font-semibold text-gray-900">E001236</td>
                            <td class="px-6 py-4">
                                <div class="flex items-center">
                                    <img src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=100&h=100&fit=crop" 
                                         alt="头像" class="w-8 h-8 rounded-full mr-2">
                                    <span class="text-sm text-gray-900">王工</span>
                                </div>
                            </td>
                            <td class="px-6 py-4 text-sm text-gray-700">男</td>
                            <td class="px-6 py-4 text-sm text-gray-700">137****5678</td>
                            <td class="px-6 py-4 text-sm text-gray-700">施工员</td>
                            <td class="px-6 py-4 text-sm text-gray-700">子公司A</td>
                            <td class="px-6 py-4 text-sm text-gray-700">工程部</td>
                            <td class="px-6 py-4 text-sm text-gray-700">消防工程A项目</td>
                            <td class="px-6 py-4 text-sm font-semibold text-gray-900">¥6,000/月</td>
                            <td class="px-6 py-4">
                                <span class="bg-yellow-100 text-yellow-600 text-xs px-2 py-1 rounded">试用期</span>
                            </td>
                            <td class="px-6 py-4">
                                <span class="bg-gray-100 text-gray-500 text-xs px-2 py-1 rounded">
                                    <i class="fas fa-times-circle mr-1"></i>未创建
                                </span>
                            </td>
                            <td class="px-6 py-4">
                                <button onclick="editEmployee('E001236')" class="text-blue-600 hover:text-blue-800 text-sm mr-3">编辑</button>
                                <button onclick="viewEmployee('E001236')" class="text-gray-600 hover:text-gray-800 text-sm">查看</button>
                                <button onclick="createUserAccount('E001236')" class="text-green-600 hover:text-green-800 text-sm ml-3">创建账号</button>
                            </td>
                        </tr>
                    </tbody>
                </table>
                
                <!-- Pagination -->
                <div class="bg-gray-50 px-6 py-4 flex items-center justify-between border-t border-gray-200">
                    <div class="text-sm text-gray-600">
                        显示 <span class="font-semibold">1-10</span> 条，共 <span class="font-semibold">156</span> 条
                    </div>
                    <div class="flex items-center gap-2">
                        <button class="px-3 py-1 border border-gray-300 rounded-lg text-sm hover:bg-gray-100">上一页</button>
                        <button class="px-3 py-1 bg-blue-600 text-white rounded-lg text-sm">1</button>
                        <button class="px-3 py-1 border border-gray-300 rounded-lg text-sm hover:bg-gray-100">2</button>
                        <button class="px-3 py-1 border border-gray-300 rounded-lg text-sm hover:bg-gray-100">3</button>
                        <button class="px-3 py-1 border border-gray-300 rounded-lg text-sm hover:bg-gray-100">下一页</button>
                    </div>
                </div>
            </div>
        </main>
    </div>

    <!-- Add/Edit Modal -->
    <div id="employeeModal" class="hidden fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4">
        <div class="bg-white rounded-xl shadow-xl w-full max-w-2xl max-h-[90vh] overflow-y-auto">
            <div class="sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
                <h3 class="text-lg font-semibold text-gray-900" id="modalTitle">新增员工</h3>
                <button onclick="closeModal()" class="text-gray-400 hover:text-gray-600">
                    <i class="fas fa-times text-xl"></i>
                </button>
            </div>
            <div class="p-6">
                <form id="employeeForm" class="space-y-4">
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <label class="block text-sm font-semibold text-gray-700 mb-2">工号 <span class="text-red-500">*</span></label>
                            <input type="text" placeholder="自动生成或手动输入" 
                                   class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                        </div>
                        <div>
                            <label class="block text-sm font-semibold text-gray-700 mb-2">姓名 <span class="text-red-500">*</span></label>
                            <input type="text" placeholder="请输入姓名" 
                                   class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                        </div>
                    </div>
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <label class="block text-sm font-semibold text-gray-700 mb-2">性别 <span class="text-red-500">*</span></label>
                            <select class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                                <option value="">请选择</option>
                                <option value="male">男</option>
                                <option value="female">女</option>
                            </select>
                        </div>
                        <div>
                            <label class="block text-sm font-semibold text-gray-700 mb-2">手机号 <span class="text-red-500">*</span></label>
                            <input type="tel" placeholder="请输入手机号" 
                                   class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                        </div>
                    </div>
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <label class="block text-sm font-semibold text-gray-700 mb-2">所属子公司 <span class="text-red-500">*</span></label>
                            <select class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                                <option value="">请选择</option>
                                <option value="1">子公司A</option>
                                <option value="2">子公司B</option>
                                <option value="3">子公司C</option>
                            </select>
                        </div>
                        <div>
                            <label class="block text-sm font-semibold text-gray-700 mb-2">所属部门 <span class="text-red-500">*</span></label>
                            <select class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                                <option value="">请选择</option>
                                <option value="1">工程部</option>
                                <option value="2">采购部</option>
                                <option value="3">财务部</option>
                                <option value="4">行政部</option>
                            </select>
                        </div>
                    </div>
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <label class="block text-sm font-semibold text-gray-700 mb-2">所属项目</label>
                            <select class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                                <option value="">不关联项目</option>
                                <option value="1">消防工程A项目</option>
                                <option value="2">消防工程B项目</option>
                                <option value="3">消防工程C项目</option>
                            </select>
                        </div>
                        <div>
                            <label class="block text-sm font-semibold text-gray-700 mb-2">岗位 <span class="text-red-500">*</span></label>
                            <input type="text" placeholder="请输入岗位" 
                                   class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                        </div>
                    </div>
                    <div>
                        <label class="block text-sm font-semibold text-gray-700 mb-2">薪资标准 <span class="text-red-500">*</span></label>
                        <input type="number" placeholder="请输入月薪（元）" 
                               class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                    </div>
                    <div>
                        <label class="block text-sm font-semibold text-gray-700 mb-2">员工状态</label>
                        <select class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                            <option value="active">在职</option>
                            <option value="probation">试用期</option>
                            <option value="leave">离职</option>
                        </select>
                    </div>
                    <div>
                        <label class="block text-sm font-semibold text-gray-700 mb-2">备注</label>
                        <textarea placeholder="请输入备注信息" rows="3" 
                                  class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
                    </div>
                </form>
            </div>
            <div class="sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4 flex items-center justify-end gap-3">
                <button onclick="closeModal()" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-100">
                    取消
                </button>
                <button onclick="saveEmployee()" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">
                    保存
                </button>
            </div>
        </div>
    </div>

    <script>
        function showAddModal() {
            document.getElementById('modalTitle').textContent = '新增员工';
            document.getElementById('employeeForm').reset();
            document.getElementById('employeeModal').classList.remove('hidden');
        }

        function editEmployee(employeeId) {
            document.getElementById('modalTitle').textContent = '编辑员工';
            // Load employee data here
            document.getElementById('employeeModal').classList.remove('hidden');
        }

        function viewEmployee(employeeId) {
            // Show view modal or navigate to detail page
            alert('查看员工详情：' + employeeId);
        }

        function closeModal() {
            document.getElementById('employeeModal').classList.add('hidden');
        }

        function saveEmployee() {
            // Save logic here
            alert('员工信息保存成功！');
            closeModal();
        }

        function exportData() {
            alert('导出功能开发中...');
        }

        function createUserAccount(employeeId) {
            // 跳转到用户管理页面，并预填员工信息
            window.location.href = 'system-settings.html?action=addUser&employeeId=' + employeeId;
        }
    </script>
</body>
</html>

